home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / procssng / ccs / ccs-11tl.lha / lbl / include / header.def < prev    next >
Encoding:
Text File  |  1993-03-15  |  3.9 KB  |  130 lines

  1. /*    HEADER . DEF
  2. %
  3. %    HEADER convert for different images
  4. %
  5. %    main purpose is for convenient, as well convert HIPS to HIPS_2
  6. %
  7. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  8.  
  9. This software is copyright (C) by the Lawrence Berkeley Laboratory.
  10. Permission is granted to reproduce this software for non-commercial
  11. purposes provided that this notice is left intact.
  12.  
  13. It is acknowledged that the U.S. Government has rights to this software
  14. under Contract DE-AC03-765F00098 between the U.S.  Department of Energy
  15. and the University of California.
  16.  
  17. This software is provided as a professional and academic contribution
  18. for joint exchange. Thus, it is experimental, and is provided ``as is'',
  19. with no warranties of any kind whatsoever, no support, no promise of
  20. updates, or printed documentation. By using this software, you
  21. acknowledge that the Lawrence Berkeley Laboratory and Regents of the
  22. University of California shall have no liability with respect to the
  23. infringement of other copyrights by any part of this software.
  24.  
  25. For further information about this notice, contact William Johnston,
  26. Bld. 50B, Rm. 2239, Lawrence Berkeley Laboratory, Berkeley, CA, 94720.
  27. (wejohnston@lbl.gov)
  28.  
  29. For further information about this software, contact:
  30.     Jin Guojun
  31.     Bld. 50B, Rm. 2275, Lawrence Berkeley Laboratory, Berkeley, CA, 94720.
  32.     g_jin@lbl.gov
  33.  
  34. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  35. %
  36. % AUTHOR:    Jin Guojun - LBL    4/1/91
  37. */
  38.  
  39. #ifndef    HHH
  40. #define    HHH
  41.  
  42. #include "hipl_format.h"
  43. #include "stdef.h"
  44.  
  45. #if    defined    COMMON_TOOL | defined FITS_IMAGE
  46. #include "fits_def.h"
  47. #endif
  48.  
  49. #define    stdin_fd    0
  50. #define    stdout_fd    1
  51. #define    stderr_fd    2
  52.  
  53.  
  54. #define    IFMT_BYTE    PFBYTE
  55. #define    IFMT_SHORT    PFSHORT
  56. #define    IFMT_LONG    PFINT
  57. #define    IFMT_FLOAT    PFFLOAT
  58. #define    IFMT_DOUBLE    PFDOUBLE
  59. #define    IFMT_ASCII    PFASCII
  60. #define    IFMT_COMPLEX    PFCOMPLEX
  61. #define    IFMT_DBLCOM    PFDBLCOM
  62. #define    IFMT_HIST    12
  63. #define    IFMT_MSBF    PFMSBF
  64. #define    IFMT_LONGPYR    PFINTPYR
  65. #define    IFMT_FLOATPYR    PFFLOATPYR
  66. #define    IFMT_SGF    IFMT_BYTE
  67. #define    IFMT_SCF    PFRGB -    2
  68. #define    IFMT_ILL    PFRGB -    1
  69. #define    IFMT_ILC    PFRGB
  70. #define    IFMT_ALPHA    PFRGBZ
  71. #define    IFMT_BITMAP    PFRGB +    2
  72. #define    IFMT_SEPLANE    PFRGB +    3
  73.  
  74. #define    CFM_SGF        0    /*    Gray Scale - 256 gray levels    */
  75. #define    CFM_SCF        1    /*    8-bit Color with ColorMAP    */
  76. #define    CFM_ILL        2    /*    3 scan line 24-bit Color    */
  77. #define    CFM_ILC        3    /*    InterLeaf Cell 24-bit Color    */
  78. #define    CFM_ALPHA    4    /*    24-bit Color + Alpha channel    */
  79. #define    CFM_BITMAP    5    /*    BitMap    1 bit 2 colors    */
  80. #define    CFM_SEPLANE    6    /*    3 separate planes    */
  81.  
  82. #define    IFMT_VFFT3D    701
  83. #define    IFMT_VFFT2D    702
  84. #define    IFMT_DVFFT3D    703
  85. #define    IFMT_DVFFT2D    704
  86. #define    IFMT_VVFFT3D    705
  87. #define    IFMT_DVVFFT3D    706
  88. #define    IFMT_STREAM    710
  89.  
  90. /***    Extension for more efficient    ***/
  91.  
  92. #ifndef    MType
  93. #define    PType    unsigned int
  94. #else
  95. #define    PType    unsigned MType
  96. #endif
  97. extern    PType    pread();
  98.  
  99. #define    h_pstep()        pstepn(4);
  100.  
  101. extern    struct    header    hhd;
  102. #define    frms    hhd.num_frame
  103.  
  104. #if    defined OLD_HIPS && !defined HIPS2_HF
  105.  
  106. #define H_init_header(hhd, name, frames, height, width, format, psize)\
  107.     init_header(hhd, name, "", frames, "", height, width, psize<<3,0,format,"")
  108. #define H_write_header(hhd)      fwrite_header(stdout_fd, hhd)
  109.  
  110. #define    H_update_header(hhd, ac, av)    update_header(hhd, ac, av)
  111.  
  112. #else
  113.  
  114. #define    clns    hhd.ocols
  115. #define    rws    hhd.orows
  116. #define    pxl_size(hhd)    hhd.sizepix
  117. #define    set_pxl_size(hhd, size)    hhd.sizepix = size
  118. #define    H_fread_header(fp, hhd)    fread_header(fp, hhd, "f")
  119. #define    H_read_header(hhd)    fread_header(stdin, hhd, "std_in")
  120. #define    H_write_header(hhd)    fwrite_header(stdout, hhd, "std_out")
  121. #define    H_fwrite_header(fp,hhd,name)    fwrite_header(fp, hhd, name)
  122. #define    H_add_seq_desc(hhd, str)    desc_append(hhd, str)
  123. #define    H_init_header(hhd, name, frames, height, width, format, psize)    \
  124.     init_header(hhd, name, "", frames, "", height, width, format, 1, "");
  125. #define    H_update_header(hhd, ac, av)    update_header(hhd, ac, av)
  126.  
  127. #endif    OLD_HIPS
  128.  
  129. #endif    HHH
  130.